<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../../resources/templates/login.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:sec="http://www.springframework.org/security/facelets/tags" >

    <ui:define name="menu_horizontal">
        <title>eCoordenador</title>
        <sec:ifAnyGranted roles="ROLE_SERVIDOR,ROLE_ADMINISTRADOR">
            <ui:include src="/site/acessoServidor/menu.xhtml" />
        </sec:ifAnyGranted>
    </ui:define>
    
    <ui:define name="corpo">
        <sec:ifAnyGranted roles="ROLE_SERVIDOR,ROLE_ADMINISTRADOR">
            
            <h:form id="formSalvar">
                <p:growl id="growl" showDetail="true" sticky="true" /> 
                <p:panel  header="Manter Tipos de Atividades Complementares"> 
                    <p:messages id="msgs"/> 
                    <h:panelGrid columns="2" >
                    
                    Servidor:
                    <!-- POPULANDO COM OBJETO -->
                    <p:selectOneMenu value="#{controllerCoordenador.coordenador.servidor}" converter="#{ServidorConverter}" style="width: 150px">
                        <f:selectItem itemLabel="-- Selecione --" noSelectionOption="true"/>
                        <f:selectItems value="#{controllerServidor.lista}" var="tipo" itemValue="#{tipo}" itemLabel="#{tipo.nome}"/>
                    </p:selectOneMenu>
                    
                    Curso:
                    <!-- POPULANDO COM OBJETO -->
                    <p:selectOneMenu value="#{controllerCoordenador.coordenador.curso}" converter="#{CursoConverter}" style="width: 150px">
                        <f:selectItem itemLabel="-- Selecione --" noSelectionOption="true"/>
                        <f:selectItems value="#{controllerCurso.lista}" var="tipo" itemValue="#{tipo}" itemLabel="#{tipo.nome}"/>
                    </p:selectOneMenu>
                    
                    Já entra em vigor?<p:selectBooleanButton value="#{controllerCoordenador.coordenador.ativo}" onLabel="Sim" offLabel="Não" />
                    
                    <p:commandButton value="Cadastrar" actionListener="#{controllerCoordenador.salvar()}" ajax="true" update="@form"/>
                    
                    </h:panelGrid>
                </p:panel>
                 </h:form>
        </sec:ifAnyGranted>
                           

    </ui:define>

</ui:composition>

